home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / aurora2c.zip / WPKBD.AML < prev    next >
Text File  |  1995-04-07  |  21KB  |  588 lines

  1.  
  2. // ───────────────────────────────────────────────────────────────────
  3. // The Aurora Editor v2.0
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // WordPerfect Keyboard definitions (included by MAIN.AML)
  7. //
  8. // If you have made any changes, save this file and select 'Recompile
  9. // the Editor' from the Set menu. Exit and re-enter the editor for
  10. // your changes to take effect.
  11. // ───────────────────────────────────────────────────────────────────
  12.  
  13. // ───────────────────────────────────────────────────────────────────
  14. //  Edit and File Manager windows
  15. // ───────────────────────────────────────────────────────────────────
  16.  
  17.   object  edit_fmgr
  18.  
  19.   // Controls
  20.   function  '≡'                                // close window
  21.     close
  22.   end
  23.  
  24.   // Menu activation
  25.   key  <esc>           gotobar                 // to last menu bar item
  26.   key  <alt =>         gotobar                 // to last menu bar item (wp)
  27.   key  <f3>            gotomenu "help"         // goto help menu (wp)
  28.   key  <shift f7>      gotomenu "print"        // goto print menu (wp)
  29.   key  <alt t>         gotobar2                // to last toolbar/drive item
  30.  
  31.   // Scroll
  32.   key  <pgdn>          pagedown                // scroll down (wp)
  33.   key  <pgup>          pageup                  // scroll up (wp)
  34.   key  <grey->         row (getviewtop)        // to page top (wp)
  35.   key  <grey+>         row (getviewbot)        // to page bottom (wp)
  36.   key  <ctrl pgup>     row 1                   // to file top
  37.   key  <ctrl pgdn>     row (getlines)          // to file bottom
  38.   key  <center>        adjustrow               // center cursor
  39.   key  <ctrl up>       rollrow -1              // scroll up one line
  40.   key  <ctrl down>     rollrow  1              // scroll down one line
  41.   key  <ctrl ->        lastpos                 // to last cursor position
  42.  
  43.   // File
  44.   key  <ctrl n>        opennew                 // new edit window
  45.   key  <shift f10>     askopen                 // open prompt (wp)
  46.   key  <alt z>         openlast                // open last window
  47.   key  <alt ->         filelist                // file list
  48.   key  <alt q>         close                   // close window
  49.   key  <f7>            closeall                // close all windows (wp)
  50.  
  51.   // Window
  52.   key  <f5>            winlist                 // window list (wp)
  53.   key  <ctrl z>        maximize                // maximize window
  54.   key  <shift f3>      nextwindow              // next window (wp)
  55.   //key  <f12>           prevwindow              // prev window
  56.   //key  <shift f3>      tile 'v'                // tile vertical
  57.   //key  <shift f4>      tile 'h'                // tile horizontal
  58.   //key  <shift f5>      cascade                 // cascade
  59.   key  <ctrl k><q>     close                   // close window
  60.  
  61.   // Search
  62.   key  <ctrl s>        askscan                 // file scan prompt
  63.   key  <ctrl b>        gotomark 't'            // find top of block
  64.   key  <ctrl 6>        cyclebook               // cycle through bookmarks
  65.  
  66.   // Print
  67.   key  <ctrl p>        print                   // print
  68.   key  <alt p>         print 'b'               // print block
  69.  
  70.   // Macro
  71.   key  <ctrl v>        askeval                 // macro command prompt
  72.   key  <ctrl f1>       shell                   // exit to DOS (wp)
  73.  
  74.   // undefined or unnamed keys
  75.   key <otherkey> (keycode)
  76.     say (getkeyname (keycode)) + " not defined"
  77.   end
  78.  
  79.  
  80. // ───────────────────────────────────────────────────────────────────
  81. //  Prompts and Edit windows
  82. // ───────────────────────────────────────────────────────────────────
  83.  
  84.   object  prompt
  85.  
  86.   // Controls
  87.   function  '≡'                                // close window
  88.     close
  89.   end
  90.  
  91.   function  '*'                                // simulate <enter>
  92.     call <enter>                               //  (2-line box only)
  93.   end
  94.  
  95.   // Cursor
  96.   key  <left>          left                    // move cursor left
  97.                        smark                   // cua marking
  98.  
  99.   key  <right>         right                   // move cursor right
  100.                        smark                   // cua marking
  101.  
  102.   key  <home>          col 1                   // to column one
  103.                        smark                   // cua marking
  104.  
  105.   key  <end>           col  getlinelen + 1     // to end of line (wp)
  106.                        smark                   // cua marking
  107.  
  108.   // Editing
  109.   key  <ins>           setting 'I' TOGGLE      // toggle insert mode (wp)
  110.   key  <del>           delchar                 // delete character (wp)
  111.  
  112.   key  <backspace>     backsp                  // delete left character (wp)
  113.   key  <ctrl [>        literal                 // enter literal character
  114.  
  115.   // Block
  116.   key  <alt f4>        markchar                // mark character (wp)
  117.   key  <alt b>         markcolumn              // mark column
  118.   key  <alt 1>         markword                // mark word
  119.   key  <alt 2>         markeol                 // mark to end of line
  120.   key  <alt u>         destroymark             // unmark
  121.  
  122.   // copy block to prompt
  123.   key  <alt c>
  124.                        instext (getmarktext)
  125.                        col  getlinelen + 1
  126.  
  127.   // paste from clipboard to prompt
  128.   key  <grey*>
  129.                        usemark _ClipName
  130.                        instext (getmarktext)
  131.                        usemark
  132.                        col  getlinelen + 1
  133.  
  134.   // copy from prompt to clipboard
  135.   //key  <grey+>         copy
  136.  
  137.   // Prompt history
  138.   key  <up>            prevhist                // retrieve prev prompt
  139.   key  <down>          nexthist                // retrieve next prompt
  140.   key  <pgup>          askhistory              // history popup menu
  141.   key  <pgdn>          askhistory              // history popup menu
  142.  
  143.   // Exit
  144.   key  <esc>           close                   // quit prompt
  145.   key  <alt q>         close                   // quit prompt
  146.  
  147.   // non-function keys
  148.   key  <char> (character)                      // typeable keys
  149.     write character
  150.   end
  151.  
  152.   // filename completion
  153.   key  <ctrl tab>      askcomplete             // filename completion
  154.   key  <tab>           askcomplete             // filename completion
  155.   end
  156.  
  157.  
  158. // ───────────────────────────────────────────────────────────────────
  159. //  Edit windows
  160. // ───────────────────────────────────────────────────────────────────
  161.  
  162.   object  edit
  163.  
  164.   // Controls
  165.   function  '≡'
  166.     close                                      // close window
  167.   end
  168.  
  169.   // Menu
  170.   key  <esc>           gotobar                 // to last menu bar item
  171.  
  172.   // Cursor
  173.  
  174.   // cursorleft with wrap (wp)
  175.   key  <left>
  176.     if getcol == 1 then                        // wrap if at column 1
  177.       if up then                               // ..and not at first line
  178.         col getlinelen + 1
  179.       end
  180.     else
  181.       left
  182.     end
  183.     smark                                      // cua marking
  184.   end
  185.  
  186.   // cursorright with wrap (wp)
  187.   key  <right>
  188.     if getcol > getlinelen then                // wrap if at end-of-line
  189.       if down then                             // ..and not at last line
  190.         col 1
  191.       end
  192.     else
  193.       right
  194.     end
  195.     smark                                      // cua marking
  196.   end
  197.  
  198.   key  <up>            up                      // move cursor up (wp)
  199.                        smark                   // cua marking
  200.  
  201.   key  <down>          down                    // move cursor down (wp)
  202.                        smark                   // cua marking
  203.  
  204.   // home key (wp)
  205.   forward  wpdelword
  206.   key  <home>
  207.     case getkey
  208.       when <up>         row (getviewtop)       // page top (wp)
  209.       when <down>       row (getviewbot)       // page bottom (wp)
  210.       when <right>      col getlinelen + 1     // end of line (wp)
  211.       when <left>       col 1                  // column 1 (wp)
  212.       when <backspace>  wpdelword              // deleteword (wp)
  213.       when <home>
  214.         case getkey
  215.           when <up>     row 1                  // file top (wp)
  216.           when <down>   row (getlines)         // file bottom (wp)
  217.         end
  218.     end
  219.     smark                                      // cua marking
  220.   end
  221.  
  222.   key  <enter>         enter                   // enter key (wp)
  223.   key  <greyenter>     enter                   // keypad enter key
  224.   key  <del>           delchar2                // delete character (wp)
  225.   key  <backspace>     backsp                  // delete left char (wp)
  226.  
  227.   // delete word
  228.   function  wpdelword
  229.     if poschar _CSet (getchar) then
  230.       if not find _CSet "yrl" then
  231.         col 1
  232.       else
  233.         right 1
  234.       end
  235.     end
  236.     delword _CSet
  237.   end
  238.  
  239.   key  <ctrl backspace>  wpdelword             // delete word (wp)
  240.  
  241.   key  <tab>           tabright                // tab right (wp)
  242.   key  <shift tab>     tableft                 // tab left (wp)
  243.  
  244.   key  <ctrl left>     prevword                // find left word
  245.                        smark
  246.  
  247.   key  <ctrl right>    nextword                // find right word
  248.                        smark
  249.  
  250.   // Scroll
  251.   key  <pgdn>          pagedown                // page down (wp)
  252.                        display
  253.                        smark
  254.  
  255.   key  <pgup>          pageup                  // page up (wp)
  256.                        display
  257.                        smark
  258.  
  259.   key  <ctrl end>      row (getviewbot)
  260.                        smark                   // to page bottom
  261.  
  262.   key  <ctrl pgup>     row 1
  263.                        smark                   // to file top
  264.  
  265.   key  <ctrl pgdn>     row (getlines)          // to file bottom
  266.                        smark
  267.  
  268.   key  <ctrl up>       rollrow -1              // scroll up one line
  269.   key  <ctrl down>     rollrow  1              // scroll down one line
  270.  
  271.   // File
  272.  
  273.   // text in/out (wp)
  274.   function inout
  275.     say "1 (S)ave, 2 (R)etrieve "
  276.     k = getkey
  277.     display
  278.     case k
  279.       when <1>, <s>, <S>   asksaveas
  280.       when <2>, <r>, <R>   askinsert
  281.     end
  282.   end
  283.  
  284.   key  <ctrl f5>       inout                   // text in/out (wp)
  285.  
  286.   key  <ctrl ]>        openword                // open file at cursor
  287.   key  <alt n>         askname                 // rename prompt
  288.   key  <f10>           save                    // save file (wp)
  289.   //key  <ctrl ins>      prevfile                // next file
  290.   //key  <ctrl del>      nextfile                // prev file
  291.   //key  <f4>            open "*.*"              // display file manager
  292.   key  <alt q>         close                   // close file/window
  293.   key  <ctrl x>        close 's'               // save & close file/window
  294.  
  295.   // Window
  296.   key  <ctrl c>        copywin                 // copy window
  297.   key  <alt h>         splitwin 'h'            // split window horizontal
  298.   key  <alt v>         splitwin 'v'            // split window vertical
  299.   //key  <ctrl f8>       toolbar                 // display tool bar
  300.   //key  <ctrl f7>       togglestyle             // toggle window style
  301.  
  302.   // Block
  303.  
  304.   function  placeblock
  305.     title = gettitle
  306.     settitle "press <enter> to place block"
  307.     loop
  308.       case getkey
  309.         when <left>  left
  310.         when <right> right
  311.         when <up>    up
  312.         when <down>  down
  313.         when <pgdn>  pagedown
  314.         when <pgup>  pageup
  315.         when <enter>
  316.           paste
  317.           break
  318.       end
  319.     end
  320.     settitle title
  321.   end
  322.  
  323.   // cut and paste (wp)
  324.   key  <ctrl del>
  325.     cut
  326.     placeblock
  327.   end
  328.  
  329.   // copy and paste (wp)
  330.   key  <ctrl ins>
  331.     copy
  332.     placeblock
  333.   end
  334.  
  335.   // wordperfect-style markblock (wp)
  336.   function  markblock
  337.     markstream
  338.     loop
  339.       k = getkey
  340.       case k
  341.         when <left>   send <left>
  342.         when <right>  send <right>
  343.         when <up>     send <up>
  344.         when <down>   send <down>
  345.         when <ctrl del>  sendkey k
  346.         when <ctrl ins>  sendkey k
  347.         when <alt f4>    break
  348.         otherwise
  349.           if find (char k mod 256) 'i' then
  350.             send <right>
  351.           end
  352.       end
  353.     end
  354.     destroymark
  355.   end
  356.  
  357.   key  <alt f4>        markblock               // mark block (wp)
  358.   key  <alt l>         markline                // mark line
  359.   key  <alt 3>         markpara "tb"           // mark paragraph
  360.   key  <alt c>         copyblock2              // copy block
  361.   key  <alt o>         copyblockover           // overlay block
  362.   key  <alt m>         moveblock2              // move block
  363.   key  <ctrl m>        moveblockover           // move block over
  364.   key  <alt d>         deleteblock2            // delete block
  365.   //key  <shift f7>      shiftblock -1           // unindent block
  366.   //key  <shift f8>      shiftblock  1           // indent block
  367.   key  <ctrl k><f>     fillblock2              // fill block with string
  368.   key  <alt r>         formatblock2 "kr"       // reformat block
  369.   key  <alt y>         formatblock2 "rj"       // reformat & right just block
  370.   key  <ctrl k><s>     saveblock2              // save block
  371.   key  <ctrl k><o>     sortblock2              // sort block
  372.   key  <ctrl k><u>     caseblock               // change block to uppercase
  373.   //key  <shift f9>      quote                   // quote a block
  374.   key  <ctrl k><c>     justblock2 'c'          // center a block
  375.  
  376.   // Search
  377.   key  <f2>            askfind                 // find prompt (wp)
  378.   key  <shift f2>      askfind                 // find reverse?? (wp)
  379.   key  <alt f2>        askrepl                 // replace prompt (wp)
  380.   key  <ctrl i>        isearch                 // incremental search
  381.   key  <ctrl h>        askfindo                // find occurrences
  382.  
  383.   key  <ctrl l>        findlast                // do last find/replace
  384.   key  <ctrl 2>        quickbook               // set quick bookmark
  385.   key  <ctrl j>        askrow                  // go to line prompt
  386.   key  <alt 7>         search2 "f/f"           // go to next fold
  387.   //key  <alt f3>        gotomatch2              // find matching char
  388.  
  389.   // Fold
  390.   key  <alt 8>         foldline                // fold next line
  391.   key  <alt 9>         foldline 'u'            // unfold next line
  392.   key  <alt g>         destroyfold2            // destroy closed/open fold
  393.   key  <alt f>         foldblock2              // fold block
  394.   key  <alt \>                                 // open or close fold
  395.     if fold? then
  396.        openfold
  397.     else
  398.        closefold
  399.     end
  400.   end
  401.   key  <alt 0>         foldall 'ds'            // destroy all folds
  402.   key  <alt [>         foldall 'os'            // open all folds
  403.   key  <alt ]>         foldall 'cs'            // close all folds
  404.  
  405.   // Edit
  406.   key  <f1>            undo                    // undo last change (wp)
  407.   key  <ctrl y>        redo                    // redo last change
  408.   key  <ctrl enter>    insline2                // insert line
  409.   //key  <ctrl backspace> delline                // delete line
  410.   key  <alt s>         splitline2              // split line
  411.   key  <alt j>         joinline                // join line
  412.   key  <alt 4>         insline (gettext)       // duplicate line
  413.   key  <alt 5>         swapline                // swap line
  414.   key  <shift f6>      centerline              // center line (wp)
  415.   key  <shift f5>      timestamp               // date/time stamp (wp)
  416.   key  <ctrl k><x>     tabfile                 // expand tabs
  417.   key  <ctrl \>        hiliteword              // highlight words
  418.  
  419.   // flush right <wp>
  420.   function flushr
  421.     if getcol <= getlinelen and getlinelen < _RMargin then
  422.       instext (copystr ' ' _RMargin - getlinelen)
  423.     end
  424.   end
  425.  
  426.   key  <alt f6>        flushr                  // flush right (wp)
  427.  
  428.   // Clipboard
  429.   key  <ctrl grey->    cut 'a'                 // cut append
  430.   key  <ctrl grey+>    copy 'a'                // copy append
  431.   key  <grey*>         paste                   // paste
  432.   key  <ctrl grey*>    paste 'o'               // paste over
  433.   key  <ctrl grey/>    clear                   // clear clipboard
  434.  
  435.   // Set
  436.   key  <ctrl w>        setting 'L' TOGGLE      // live word wrap toggle
  437.   key  <ctrl d>        setting 'D' TOGGLE      // line draw toggle
  438.  
  439.   // Macro
  440.   //key  <shift f10>     compilemacro2 (getbufname)  // compile current file
  441.   //key  <shift f11>     runmacro2 (getbufname)      // run current file
  442.   key  <shift f12>     pickmacro                   // macro picklist
  443.   key  <shift f1>      opencfg "config"        // configuration (wp)
  444.  
  445.   // non-function (typeable) keys
  446.   key  <char> (character)                      // typeable keys
  447.     write character
  448.   end
  449.  
  450.   // Other
  451.   key  <ctrl q><q>     askrepkey               // repeat entered keys
  452.  
  453.   // invoke a spell checker from within an edit window (wp)
  454.   // (replace 'jspell' with your favorite spell checker)
  455.   key  <ctrl f2>
  456.     save                                       // save the current file
  457.     run  "jspell " + getbufname  "ck"          // call spellchecker
  458.     reopen                                     // reopen current file
  459.   end
  460.  
  461. // ───────────────────────────────────────────────────────────────────
  462. //  File Manager windows
  463. // ───────────────────────────────────────────────────────────────────
  464.  
  465.   object  fmgr
  466.  
  467.   // Menu activation
  468.   key  <tab>           gotobar2                // to drive menu bar
  469.  
  470.   // Cursor
  471.   key  <left>          rollcol -1              // scroll left one column
  472.   key  <right>         rollcol  1              // scroll right one column
  473.   key  <home>          col 1                   // scroll to column one
  474.  
  475.   // move cursor up
  476.   key  <up>
  477.     if shiftkey? then
  478.       fmark
  479.     end
  480.     up
  481.   end
  482.  
  483.   // move cursor down
  484.   key  <down>
  485.     if shiftkey? then
  486.       fmark
  487.     end
  488.     down
  489.   end
  490.  
  491.   // file manager commands (single character command codes)
  492.   key  <char> (c)
  493.  
  494.     // toggle file mark
  495.     if c == ' ' then
  496.       fmark
  497.  
  498.     // <shift-character> commands
  499.     elseif shiftkey? then
  500.       case  locase c
  501.         when 'o'     fopen 'o'                   // open file/directory
  502.         when 'e'     fopen 'e'                   // open file/directory
  503.         when 'z'     fopen "ze"                  // open maximized
  504.         when 'b'     fopen 'b'                   // open binary file
  505.         when 'y'     fopen "be"                  // open binary in one window
  506.         when 'k'     openkey2 (getffile)         // open key macro file
  507.         when 'm'     fmove                       // move file
  508.         when 'c'     fcopy                       // copy file
  509.         when 'd'     fdelete                     // delete file
  510.         when 'n'     frename                     // rename file
  511.         when 'r'     frun 'c'                    // run program/batch file
  512.         when 'p'     fprint                      // print file
  513.         when 'a'     fattr                       // change file attributes
  514.         when 't'     ftouch                      // touch file
  515.  
  516.         // spell checker
  517.         when 's'     run "jspell " + getffile  "ck"
  518.  
  519.         // unarchive .ZIP or .LZH files
  520.         when 'u'
  521.           f = getffile
  522.           run (if? (pos ".lzh" f 'i') "lha e " "pkunzip ") + f  "ck"
  523.           reopen
  524.  
  525.         // view .ZIP or .LZH archives
  526.         when 'v'
  527.           f = getffile
  528.           runcap (if? (pos ".lzh" f 'i') "lha v " "pkunzip -v ") + f
  529.       end
  530.  
  531.     // hotkey to files
  532.     else
  533.       onhotkey c
  534.     end
  535.  
  536.   // File
  537.   key  <ctrl backspace>   fup                  // parent directory
  538.  
  539.   // Mark
  540.   key  <alt m>         fmark "ma"              // mark all files
  541.   key  <alt u>         fmark "ua"              // unmark all
  542.  
  543.   // Command
  544.   key  <enter>         fopen '1'               // open file (one only)
  545.   key  <ctrl enter>    fopen 'q'               // open file (close fmgr)
  546.   key  <del>           fdelete                 // delete file
  547.  
  548.   // Sort
  549.   key  <alt n>         fsort 'n'               // sort by name
  550.   key  <alt s>         fsort 's'               // sort by size
  551.   key  <alt d>         fsort 'd'               // sort by date/time
  552.   key  <alt o>         fsort 'o'               // no sort (DOS order)
  553.  
  554.   // Print
  555.   key  <ctrl p>        print                   // print fmgr contents
  556.   end
  557.  
  558.  
  559. // ───────────────────────────────────────────────────────────────────
  560. //  Movable/Sizable windows
  561. // ───────────────────────────────────────────────────────────────────
  562.  
  563.   object  win
  564.  
  565.   //key  <ctrl f5>       sizekey                 // move/size with kbd
  566.   //key  <ctrl f6>       pankey                  // pan video with kbd
  567.  
  568.   key  <alt ins>       sizewin -2 -1 -2 -1 2   // move window northwest
  569.   key  <alt del>       sizewin  2  1  2  1 2   // move window southeast
  570.   end
  571.  
  572.  
  573. // ───────────────────────────────────────────────────────────────────
  574. //  All windows
  575. // ───────────────────────────────────────────────────────────────────
  576.  
  577.   object  mon
  578.  
  579.   // key macros (wp)
  580.   key  <ctrl f10>      record                  // toggle record setting
  581.   key  <alt f10>       play                    // play scrap key macro
  582.  
  583.   // define multi-key prefixes
  584.   key  <ctrl k>        prefix <ctrl k>         // define <ctrl k> prefix
  585.   key  <ctrl o>        prefix <ctrl o>         // define <ctrl o> prefix
  586.   key  <ctrl q>        prefix <ctrl q>         // define <ctrl q> prefix
  587.  
  588.